package cn.jit.enums;

public enum UserQueryStateEnum {
	SUCCESS(1, "查询成功"), NO_NUMBER(0, "未查到相关用户"), INNER_ERROR(-2, "系统异常");

	private int state;

	private String stateInfo;

	private UserQueryStateEnum(int state, String stateInfo) {
		this.state = state;
		this.stateInfo = stateInfo;
	}

	public int getState() {
		return state;
	}

	public String getStateInfo() {
		return stateInfo;
	}

	public static UserQueryStateEnum stateOf(int index) {
		for (UserQueryStateEnum state : values()) {
			if (state.getState() == index) {
				return state;
			}
		}
		return null;
	}
	
}
